package com.dawn.module.mp.dal.mysql.msgtemplatelog;

import java.util.*;

import com.dawn.framework.common.pojo.PageResult;
import com.dawn.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.dawn.framework.mybatis.core.mapper.BaseMapperX;
import com.dawn.module.mp.dal.dataobject.msgtemplatelog.MsgTemplateLogDO;
import org.apache.ibatis.annotations.Mapper;
import com.dawn.module.mp.controller.admin.msgtemplatelog.vo.*;

/**
 * 模板消息记录 Mapper
 *
 * @author mamba 4 left
 */
@Mapper
public interface MsgTemplateLogMapper extends BaseMapperX<MsgTemplateLogDO> {

    default PageResult<MsgTemplateLogDO> selectPage(MsgTemplateLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MsgTemplateLogDO>()
                .eqIfPresent(MsgTemplateLogDO::getAppid, reqVO.getAppid())
                .eqIfPresent(MsgTemplateLogDO::getAccountId, reqVO.getAccountId())
                .eqIfPresent(MsgTemplateLogDO::getTouser, reqVO.getTouser())
                .eqIfPresent(MsgTemplateLogDO::getTemplateId, reqVO.getTemplateId())
                .eqIfPresent(MsgTemplateLogDO::getData, reqVO.getData())
                .eqIfPresent(MsgTemplateLogDO::getUrl, reqVO.getUrl())
                .eqIfPresent(MsgTemplateLogDO::getMiniprogram, reqVO.getMiniprogram())
                .betweenIfPresent(MsgTemplateLogDO::getSendTime, reqVO.getSendTime())
                .eqIfPresent(MsgTemplateLogDO::getSendResult, reqVO.getSendResult())
                .eqIfPresent(MsgTemplateLogDO::getStatus, reqVO.getStatus())
                .eqIfPresent(MsgTemplateLogDO::getMessage, reqVO.getMessage())
                .betweenIfPresent(MsgTemplateLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MsgTemplateLogDO::getId));
    }

}
